]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Use new AdwPreferencesGroup's bind_model
authorÓscar Fernández Díaz <oscfdezdz@tuta.io>
Mon, 11 Aug 2025 17:00:10 +0000 (19:00 +0200)
committerÓscar Fernández Díaz <oscfdezdz@tuta.io>
Mon, 11 Aug 2025 17:09:41 +0000 (19:09 +0200)
Allows us to get rid of GtkListBox and bind extension models directly to
each AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3833>

subprojects/extensions-app/data/ui/extensions-window.ui
subprojects/extensions-app/js/extensionsWindow.js

index 5931ce4e4040570c1a1c2e09b62225e75b3da13b..a699140b5cb8d6261afc8e7bace4a1118b2fce5a 100644 (file)
                                       bind-source="userListModel"
                                       bind-property="n-items"
                                       bind-flags="sync-create"/>
-                            <child>
-                              <object class="GtkListBox" id="userList">
-                                <property name="selection-mode">none</property>
-                                <accessibility>
-                                  <relation name="labelled-by">userGroup</relation>
-                                </accessibility>
-                                <style>
-                                  <class name="boxed-list"/>
-                                </style>
-                              </object>
-                            </child>
                           </object>
                         </child>
                         <child>
                                       bind-source="systemListModel"
                                       bind-property="n-items"
                                       bind-flags="sync-create"/>
-                            <child>
-                              <object class="GtkListBox" id="systemList">
-                                <property name="selection-mode">none</property>
-                                <accessibility>
-                                  <relation name="labelled-by">systemGroup</relation>
-                                </accessibility>
-                                <style>
-                                  <class name="boxed-list"/>
-                                </style>
-                              </object>
-                            </child>
                           </object>
                         </child>
                       </object>
                 <property name="child">
                   <object class="AdwPreferencesPage">
                     <child>
-                      <object class="AdwPreferencesGroup">
-                        <child>
-                          <object class="GtkListBox" id="searchList">
-                            <property name="selection-mode">none</property>
-                            <accessibility>
-                              <property name="label" translatable="yes">Search Results</property>
-                            </accessibility>
-                            <style>
-                              <class name="boxed-list"/>
-                            </style>
-                          </object>
-                        </child>
+                      <object class="AdwPreferencesGroup" id="searchGroup">
+                        <accessibility>
+                          <property name="label" translatable="yes">Search Results</property>
+                        </accessibility>
                       </object>
                     </child>
                   </object>
index c8086c61556945d75a066aa0d2acdf66651cdc3c..fdb60de282ebeea372382b36711feaf3d53ce53b 100644 (file)
@@ -24,10 +24,8 @@ export const ExtensionsWindow = GObject.registerClass({
         'systemListModel',
         'searchListModel',
         'userGroup',
-        'userList',
         'systemGroup',
-        'systemList',
-        'searchList',
+        'searchGroup',
         'mainStack',
         'searchBar',
         'searchEntry',
@@ -80,10 +78,7 @@ export const ExtensionsWindow = GObject.registerClass({
         this._searchListModel.connect('notify::n-items',
             () => this._syncVisiblePage());
 
-        this._userList.connect('row-activated', (_list, row) => row.activate());
         this._userGroup.connect('notify::visible', () => this._syncVisiblePage());
-
-        this._systemList.connect('row-activated', (_list, row) => row.activate());
         this._systemGroup.connect('notify::visible', () => this._syncVisiblePage());
 
         const {extensionManager} = this.application;
@@ -97,11 +92,11 @@ export const ExtensionsWindow = GObject.registerClass({
 
         this._sortModel.model = extensionManager.extensions;
 
-        this._userList.bind_model(this._userListModel,
+        this._userGroup.bind_model(this._userListModel,
             extension => new ExtensionRow(extension));
-        this._systemList.bind_model(this._systemListModel,
+        this._systemGroup.bind_model(this._systemListModel,
             extension => new ExtensionRow(extension));
-        this._searchList.bind_model(this._searchListModel,
+        this._searchGroup.bind_model(this._searchListModel,
             extension => new ExtensionRow(extension));
 
         extensionManager.connect('extensions-loaded',